home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Graphics Programming (2nd Edition) / Visual Basic Graphics Programming 2nd Edition.iso / OldSrc / CH2 / SRC / GETBITS.BAS < prev    next >
BASIC Source File  |  1997-01-17  |  1KB  |  33 lines

  1. Attribute VB_Name = "GetBits"
  2. Option Explicit
  3.  
  4. #If Win32 Then
  5.     Type BITMAP ' 24 bytes
  6.         bmType As Long
  7.         bmWidth As Long
  8.         bmHeight As Long
  9.         bmWidthBytes As Long
  10.         bmPlanes As Integer
  11.         bmBitsPixel As Integer
  12.         bmBits As Long
  13.     End Type
  14.     Global Const BITMAP_SIZE = 24
  15.     Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
  16.     Declare Function GetBitmapBits Lib "gdi32" (ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As Any) As Long
  17.     Declare Function SetBitmapBits Lib "gdi32" (ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As Any) As Long
  18. #Else
  19.     Type BITMAP ' 14 bytes
  20.         bmType As Integer
  21.         bmWidth As Integer
  22.         bmHeight As Integer
  23.         bmWidthBytes As Integer
  24.         bmPlanes As Byte
  25.         bmBitsPixel As Byte
  26.         bmBits As Long
  27.     End Type
  28.     Global Const BITMAP_SIZE = 14
  29.     Declare Function GetObject Lib "GDI" (ByVal hObject As Integer, ByVal nCount As Integer, lpObject As Any) As Integer
  30.     Declare Function GetBitmapBits Lib "GDI" (ByVal hBitmap As Integer, ByVal dwCount As Long, lpBits As Any) As Long
  31.     Declare Function SetBitmapBits Lib "GDI" (ByVal hBitmap As Integer, ByVal dwCount As Long, lpBits As Any) As Long
  32. #End If
  33.